/**
 * 创建人:  @author 蔡佳龙    
 * 创建时间:  2023年11月23日 16:56
 * 项目名称:  MES
 * 文件名称:  MesApplication
 * 文件描述:  @Description: 启动类
 * @Copyright: 2021-2023
 *
 */
package com.cjl;

import com.bstek.ureport.console.UReportServlet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableAsync;


// 开启线程异步
@EnableAsync
@ImportResource("classpath:ureport-console-context.xml")
@SpringBootApplication
public class MesApplication {
    public static void main(String[] args) {
        SpringApplication.run(MesApplication.class,args);
        System.out.println("MES启动成功！！！");
    }

    @Bean
    public ServletRegistrationBean urportServlet(){
        ServletRegistrationBean bean = new ServletRegistrationBean(new UReportServlet());
        bean.addUrlMappings("/ureport/*");
        return bean;
    }
}
